#coding=utf8
import cPickle as pickle

def debug_output(info):
    from sys import stderr
    stderr.write(info.__repr__() + '\n')

def val_to_str(val):
    return pickle.dumps(val).encode('base64')

def str_to_val(s):
    return pickle.loads(s.decode('base64'))
